<?php

namespace App\Http\Controllers\Admin;

use App\Repository\Order\OrderRepository as model;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller as BaseController;
use App\Repository\Pay\WxNativePayRepository;

// 分销商
class PayController extends BaseController
{
  public function __construct()
  {
  }

  public function index(Request $request)
  {
  }
  // 生成微信支付的url
  public function createPayUrl(Request $request)
  {
    $model = new WxNativePayRepository();
    $price = 1;
    $orderno = 'HK_' . mt_rand(00000, 99999);
    $res = $model->pay($price, $orderno);
    return $this->returnMsg(200, '二维码生成成功', ['url' => $res]);
  }
}
